<template>
  <div>
    <h2>parent--parent-父组件</h2>
    <h2 @click="changeCountadd"> {{count}}</h2>
    <h3>world---{{world}}</h3>
    <p>
        <input type="text" v-model="world">
    </p>
    <button @click="changechildone">点击修改子组件one</button>
    <hr>
    <Childone
    v-if="show"
    :count="count"
    :world="world"
    ref="childone"
    >
    </Childone>
    <hr>
    <Childtwo
    @changeparentworld='getnoeworld'
    :changeshow="changeshow"
    ></Childtwo>
  </div>
</template>
<script>
import Childone from '@/components/Childone.vue'
import Childtwo from "@/components/Childtwo.vue"
export default {
    name:'parent',
    methods: {
        changeCountadd(){
            this.count++
        },
        changechildone(){
            this.$refs.childone.msg='学完你就很牛逼'
        },
        getnoeworld(world){
            this.world=world
        },
        changeshow(){
            this.show=!this.show
        }
    },
   components: {
        Childone,
        Childtwo
    },
    data () {
        return {
            count : 0.9,
            world:'万能没用啊万能',
            show:true           
        }
    }
}
</script>